import request from "@/utils/request";

/**
 * 带条件分页查询司机
 * @param truck_driverDto
 * @returns {*}
 */
export function queryTruckDriverVo(truck_driverDto){
  return request({
    url: '/pd-base/truck_driver/queryTruckDriverVo',
    method: 'POST',
    data: truck_driverDto
  })
}

/**
 * 根据司机id修改司机所属车队
 * @param truck_driverBean
 * @returns {*}
 */
export function updateTruckDriverVo(truck_driverBean){
  return request({
    url: '/pd-base/truck_driver/updateTruckDriverVo',
    method: 'POST',
    data: truck_driverBean
  })
}

/**
 * 根据司机查询司机驾驶证信息
 * @param id
 * @returns {*}
 */
export function getTruckDriverLicense(id){
  return request({
    url: '/pd-base/truck_driver/getTruckDriverLicense?id='+id,
    method: 'GET'
  })
}


/**
 * 根据id查询图片
 * @param id
 * @returns {*}
 */
export function getimagesUrl(id){
  return request({
    url: '/pd-base/truck_driver/getimagesUrl?id='+id,
    method: 'GET'
  })
}

/**
 * 根据id查询图片
 * @param id
 * @returns {*}
 */
export function findTruck_driverMobileVo(id){
  return request({
    url: '/pd-base/truck_driver/findTruck_driverMobileVo',
    method: 'POST',
    data: id
  })
}

/**
 * 查询所有用户信息
 * @param id
 * @returns {*}
 */
export function userRoleName(userDTO){
  return request({
    url: '/pd-auth/user/userRoleName',
    method: 'POST',
    data: userDTO
  })
}


/**
 * 添加司机信息
 * @param id
 * @returns {*}
 */
export function addTruckDriver(truck_driverDto){
  return request({
    url: '/pd-base/truck_driver/addTruckDriver',
    method: 'POST',
    data: truck_driverDto
  })
}


export function getAllFleetByAgency(agency_id) {
  return request({
    url: `/pd-base/fleet/getAllFleetByAgencyId/${agency_id}`,
    method: "get",
    params: agency_id
  });
}


/**
 * 添加司机驾驶证信息
 * @param id
 * @returns {*}
 */
export function addtruckdriverlicense(truck_driver_licenseBean){
  return request({
    url: '/pd-base/TruckDriverLicenseController/addtruckdriverlicense',
    method: 'POST',
    data: truck_driver_licenseBean
  })
}
